package com.yinNuo.collectWool.core.exception;

/**
* create by: yinNuo
* create at: 2021/12/18 下午7:17
* description: 所有业务异常枚举
*/
public enum BizExceptionEnum implements AbstractBaseExceptionEnum {

	/**
	 * 权限和数据问题
	 */
	DB_RESOURCE_NULL(400, "数据库中没有该资源"),
	NO_PERMISSION(405, "权限异常"),
	REQUEST_INVALIDATE(400, "请求数据格式不正确"),

	/**
	 * 错误的请求
	 */
	REQUEST_NULL(400, "数据异常"),
	REQUEST_FORMAT_EXCEPTION(400, "数据类型异常"),
	SESSION_TIMEOUT(400, "会话超时"),
	SERVER_ERROR(500, "服务器异常"),

	/**
	 * 非空判断提示
	 */
	NULL_BY_PARAMS(400, "参数为空"),

	/**
	 * token异常
	 */
	TOKEN_EXPIRED(401, "token过期"),
	TOKEN_ERROR(401, "token验证失败");

	BizExceptionEnum(int code, String message) {
		this.code = code;
		this.message = message;
	}

	private Integer code;

	private String message;

	@Override
	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	@Override
	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
	}
